import { createRouter, createWebHashHistory } from 'vue-router'


const routes = [
  {
    path: '/',
    redirect:'/login'
  },
  /* {
    path: '/im',
    name: 'Im',
    component: () => import("@/views/Im"),
  }, */
  {
    path: '/home',
    name: 'Manage',
    component:()=> import('@/views/manage'),
    children:[
      {
        path:'/main',
        name:'main',
        meta:{
          title:'列表'
        },
        component:()=>import('@/components/Main')
      },
      {
        path:'/im',
        name:'im',
        meta:{
          title:'聊天室'
        },
        component: () => import("@/views/Im"),
      },
      {
        path:'/pratice',
        name:'pratice',
        meta:{
          title:'刷题'
        },
        component: () => import("@/views/pratice"),
      },
      {
        path:'/sy',
        name:'sy',
        meta:{
          title:'首页'
        },
        component: () => import("@/views/sy"),
      },
    ]
  },

  {
    path: '/login',
    name: 'login',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/login.vue')
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
